from rest_framework import serializers
from rest_framework_mongoengine import serializers as mongoserializers

from policy.models import Policy, AwardGuide, Awards, AwardsDeclaration, WinningNotice, PolicyInterpretion


class ListPolicySerializer(mongoserializers.DynamicDocumentSerializer):
    class Meta:
        model = Policy
        fields = ('id', 'title', 'unit', 'data', 'introduction', 'keywords')

class PolicySerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = Policy
        fields = '__all__'

class AwardsGuideSerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = AwardGuide
        fields = '__all__'

class AwardsSerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = Awards
        fields = '__all__'

class AwardsDeclarationSerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = AwardsDeclaration
        fields = '__all__'


class WinningNoticeSerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = WinningNotice
        fields = '__all__'

class PolicyInterpretionSerializer(mongoserializers.DynamicDocumentSerializer):
    id = serializers.CharField()

    class Meta:
        model = PolicyInterpretion
        fields = '__all__'
